/*
 *  * Copyright (c) 2020-2030  Xiamen Nascent Corporation. All rights reserved. 
 *
 *  * https://www.nascent.cn
 *
 *  * 厦门南讯股份有限公司创立于2010年，是一家始终以技术和产品为驱动，帮助大消费领域企业提供客户资源管理（CRM）解决方案的公司。
 *  * 福建省厦门市软件园二期观日路22号401
 *  * 客服电话 400-009-2300
 *  * 电话 +86（592）5971731 传真 +86（592）5971710
 *
 *  * All source code copyright of this system belongs to Xiamen Nascent Co., Ltd.
 *  * Any organization or individual is not allowed to reprint, publish, disclose, embezzle, sell and use it for other illegal purposes without permission!
 */

package com.example.demo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 * 日志拦截器
 **/
@Slf4j
public class LogInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String url = request.getRequestURI();
        log.info("logInterceptor: preHandle.");
        return true;
    }

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        log.info("logInterceptor: afterCompletion.");
    }

}
